object SplitEvents {

  def main(args: Array[String]): Unit = {


    val eventList:List[(Long,String,Long)] = List((1L,"e1",100000L),(1,"e2",100002),(1,"e4",100005),(1,"e3",100004),(1,"e4",100005),(1,"e3",100004),(1,"e3",100004))
                                           //List((1,e1,100000), (1,e2,100002), (1,e4,100005), (1,e3,100004), (1,e4,100005))
    val idx: Int = eventList.reverse.indexWhere(tp => tp._2.equals("e4"))
    val cleanedEvents: List[(Long, String, Long)] = eventList.reverse.slice(idx, eventList.size)

    println(cleanedEvents.reverse)


  }

}
